package abs

import "my-gameserver-go/core/mynet/conn"

func NewInnerHandler(f func()) GenericInnerHandler {
	return GenericInnerHandler{F: f}
}

//GenericInnerHandler  basehandler GenericInnerHandler 抽象
type GenericInnerHandler struct {
	F func()
}

func (inner GenericInnerHandler) Action() {
	inner.F()
}

// basehandler  GenericProtoHandler抽象

type ProtoMessageHandler interface {
	ProtoAction(Conn *conn.GameConnection, Data []byte)
}

type GenericProtoHandler struct {
	Conn *conn.GameConnection
	Data []byte
	ProtoMessageHandler
}

func (proto GenericProtoHandler) Action() {
	proto.ProtoAction(proto.Conn, proto.Data)
}
